<?php
namespace lightblog\home\controller;

use lightblog\engine\controller;
use lightblog\home\model\commentModel;

class comment extends controller {
    public function commentAction() {
        if (\lightblog::$app->request->method != 'POST') {
            $this->error('Shit happend...');
        }        
        
        $model = new commentModel();
        $res = $model->newComment();

        if ($res) {
            $this->success('成功, 跳转到其他页面');
        } else {
            $this->error('失败, 请稍后重试...');
        }
    }

}
